/*
 * zcontainer.c
 *
 *  Created on: 24 avr. 2012
 *      Author: Florian.B
 */

#include "zcontainer.h"
#include "zserver.h"

ZContainer * create_ZContainer()
    {
    ZContainer *zContainer;
    GtkWidget *pane;
    zContainer = (ZContainer *) malloc(sizeof(ZContainer));
    zContainer->vbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 1);

    pane = gtk_paned_new(GTK_ORIENTATION_HORIZONTAL);
    gtk_box_pack_start(GTK_BOX(zContainer->vbox), pane, TRUE, TRUE, 1);
    zContainer->zFile = create_ZFile();
    gtk_paned_pack1(GTK_PANED(pane), getContainer_ZFile(zContainer->zFile),
	    TRUE, FALSE);
    zContainer->zServer = create_ZServer(zContainer->zFile);
    gtk_paned_add2(GTK_PANED(pane), getContainer_ZServer(zContainer->zServer));
    addServer_ZServer(zContainer->zServer, "localhost", "8080", "localhost");
    gtk_paned_set_position(GTK_PANED(pane), 500);
    return zContainer;
    }

GtkWidget *getContainer_ZContainer(ZContainer *zContainer)
    {
    return zContainer->vbox;
    }

ZServer * getZServer_ZContainer(ZContainer *zContainer)
    {
    if(zContainer == NULL)
	return NULL;
    return zContainer->zServer;
    }
